public class ThreadDemo5 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("1");
        });
        t1.start();
        Thread.sleep(2000);
        System.out.println("2");
    }
}
